package com.viethp.mt.objects;

import org.ksoap2.serialization.SoapObject;

public class SignUpResponse {
	private static final String ERROR_CODE = "ErrorCode";
	private static final String USER_ID = "userid";
	private int user_id;
	private ErrorCode errorCode;

	public SignUpResponse(SoapObject result) {
		if (result != null && result.hasProperty(ERROR_CODE)) {
			this.errorCode = new ErrorCode(
					(SoapObject) result.getProperty(ERROR_CODE));
		} else {
			this.user_id = Integer.parseInt(result.getProperty(USER_ID)
					.toString());
			this.errorCode = null;
		}
	}

	public int getUser_id() {
		return user_id;
	}

	public void setUser_id(int user_id) {
		this.user_id = user_id;
	}

	public ErrorCode getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(ErrorCode errorCode) {
		this.errorCode = errorCode;
	}
}
